﻿using Microsoft.Extensions.DependencyInjection;

namespace AutoTest.Framework.Ioc
{
    /// <summary>
    /// 
    /// </summary>
    public interface INamedServiceProviderBuilder
    {
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <typeparam name="TImplementation"></typeparam>
        /// <param name="serviceName"></param>
        /// <param name="lifetime"></param>
        /// <returns></returns>
        INamedServiceProviderBuilder AddNamedService<TService, TImplementation>(string serviceName, ServiceLifetime lifetime)
            where TService : class
            where TImplementation : class, TService;
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <typeparam name="TImplementation"></typeparam>
        /// <param name="serviceName"></param>
        /// <param name="lifetime"></param>
        /// <returns></returns>
        INamedServiceProviderBuilder TryAddNamedService<TService, TImplementation>(string serviceName, ServiceLifetime lifetime)
            where TService : class
            where TImplementation : class, TService;

        void Build();
    }
}
